# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-rpc-xml
_pkgname=RPC-XML
pkgver=0.82
pkgrel=5
pkgdesc='A set of classes for core data, message and XML handling.'
arch=('any')
license=('PerlArtistic' 'GPL')
depends=('perl' 'perl-xml-libxml' 'perl-libwww')
optdepends=('perl-xml-libxml: XML::LibXML support'
            'perl-datetime-format-iso8601: DateTime::Format::ISO8601 support'
            'perl-net-server: Net::Server support')
url='https://metacpan.org/pod/RPC::XML'
source=("https://cpan.metacpan.org/authors/id/R/RJ/RJRAY/$_pkgname-$pkgver.tar.gz")
sha512sums=('e5d1092a2807c2bd423502dd2ed53a72c57384b67bb4709e86a64a6fe37ce8af580998e62fcfa6a48d66d5308d9dc270c74e4293617b9f23a654e379cde4025f')

prepare() {
  cd "$_pkgname-$pkgver"

  export PERL_MM_USE_DEFAULT=1 PERL5LIB="" PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

  /usr/bin/perl Makefile.PL
}

build() {
  cd "$_pkgname-$pkgver"

  make
}

package() {
  cd "$_pkgname-$pkgver"

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

